﻿using Lib.WPF.Core;
using System.Windows;
using System.Windows.Input;

namespace Lib.WPF; 
/// <summary>
/// 入口程序
/// </summary>
public partial class Main  {
    /// <summary>
    /// 
    /// </summary>
    public Main() {

        InitializeComponent();

        CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, (Sender, e) => {
            WindowState = WindowState.Minimized;
        }));
        CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, (Sender, e) => {
            WindowState = WindowState.Maximized;
        }));
        CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, (Sender, e) => {
            WindowState = WindowState.Normal;
        }));
        CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (Sender, e) => {
            Close();
        }));

        DataContext = new  ViewModels.Main();
    }

}